package com.base.cn.platform.os.entity.manage.teacher;


import com.base.cn.platform.os.common.annotation.ImgAttr;
import com.base.cn.platform.os.common.mybatis.BaseEntity;
import com.base.cn.platform.os.common.utils.ObjectUtils;
import com.base.cn.platform.os.entity.manage.subject.SysSubject;
import com.base.cn.platform.os.entity.manage.user.SysUser;
import lombok.Data;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 讲师实体
 *
 * @author s.li
 * @create 2018-04-08-14:40
 */
@Data

public class SysTeacher extends BaseEntity {
    private static final long serialVersionUID = 4180412407810181948L;
    /**讲师名*/
    private String teacherName;
    /**讲师关联的管理员ID*/
    private BigDecimal sysUserId;
    /**讲师描述*/
    @ImgAttr
    private String depict;
    /**老师类型，1平台自有，2入驻讲师*/
    private Integer teacherType;
    /**是否是问题讲师,0否，1是*/
    private Integer isQuestion;
    /**问答类型ID*/
    private BigDecimal qaTypeId;
    /**提问收费金额*/
    private Double questionFee;
    /**分成比例*/
    private Double separateInto;
    /**提现账号类型，1支付宝，2微信，3银行账号*/
    private Integer accountType;
    /**提现账号（支付宝、微信、银行卡号）*/
    private String account;
    /**开户行地址（用于accountType=3）*/
    //private String accountAddress;
    /**账号真实姓名*/
    private String realName;
    /**排序*/
    private Integer sort;
    /**课程量*/
    private Integer courseNum;
    /**问题数*/
    private Integer questionNum;
    /**学生数*/
    private Integer userNum;
    //身份  1讲师 2班主任
    private String teacherIdentity;
    /**
     * 讲师收益
     */
    private List<TeacherExpand> expand;
    //讲师关联的专业
    private List<SysSubject> sysSubjectList;
    //讲师的创建人
    private SysUser sysCreateUser;
    //讲师关联的管理用户
    private SysUser sysUser;
    //讲师关联课程
    private Map<String, Object> courseMap;
    //讲师关联的问答分类（讲师可提问时使用）
    private Map<String, Object> qaType;


    public Map getExpand(){
        HashMap<String, Object> hashMap = new HashMap<>();
        if(ObjectUtils.isEmpty(expand)){
            return hashMap;
        }
        for (TeacherExpand  expand : expand) {
            hashMap.put(expand.getStatus().toString(),expand.getPrice());
        }
        return hashMap;
    }
}
